package com.wenqiner.requesttool.core.business.lingyin;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;

/**
 * @author rhf
 * @date 2023-03-01
 **/
@Data
public class ParamData<T> implements Serializable {
    /**
     * responseCode
     */
    private Integer responseCode;
    /**
     * responseMsg
     */
    private String responseMsg;
    /**
     * secretCode
     */
    private String secretCode;
    /**
     * encryptedData
     */
    private String encryptedData;
    /**
     * sign
     */
    private String sign;
    /**
     * 数据
     */
    private T data;

    /**
     * 是否成功
     * @author rhf
     * @return java.lang.Boolean
     */
    @JSONField(serialize = false)
    @JsonIgnore
    public Boolean isSuccess(){
        return getResponseCode() == 100;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
